from student import Student

class MenuItem:
    def __init__(self, no, name):
        self.no = no
        self.name = name


class MenuManager:

    def __init__(self):
        self.menu_list = [
            MenuItem(1, '增加学生信息'),
            MenuItem(2, '删除学生信息'),
            MenuItem(3, '修改学生信息'),
            MenuItem(4, '查询学生信息'),
            MenuItem(5, '所有学生信息'),
            MenuItem(6, '按照成绩排序'),
            MenuItem(0, '退出程序'),
        ]

        self.option = 0

    def print_menu(self):
        # print('*' * 30)
        print('*' * 12, '菜单开始', '*' * 12)

        for item in self.menu_list:
            print(f'{item.no} {item.name}')
        print('*' * 12, '菜单结束', '*' * 12)
        # print('*' * 30)

    def print_student_list(self, stu_list):
        print(f'学号 姓名 数学成绩 英语成绩 语文成绩 总分')

        if len(stu_list) == 0:
            print('no data!')
            return

        for item in stu_list:
            print(
                f'{item.id:<4} {item.name:<5} {item.math_score:<6} {item.english_score:<6} {item.chinese_score:<6} {item.sum_score:<6}')

    def add(self):
        s = Student()


if __name__ == '__main__':
    menu_manager = MenuManager()
    menu_manager.print_menu()
